package com.loki.controller;

import com.loki.bean.User;
import com.loki.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @date 2021/3/26 3:13
 * @Description
 */
@Controller
public class UserController {
    @Autowired
    UserService userService;
    @RequestMapping("/select")
    public String select(Model model){
        List<User> userList = userService.getUsers();
        System.out.println(userList);
        model.addAttribute("users", userList);
        return "select";
    }
}
